/**
 * 初始化装车登记审核详情对话框
 */
var CarryBasicInformationInfoDlg = {
    carryBasicInformationInfoData : {}
};

/**
 * 清除数据
 */
CarryBasicInformationInfoDlg.clearData = function() {
    this.carryBasicInformationInfoData = {};
}

/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
CarryBasicInformationInfoDlg.set = function(key, val) {
    this.carryBasicInformationInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
    return this;
}

/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
CarryBasicInformationInfoDlg.get = function(key) {
    return $("#" + key).val();
}

/**
 * 关闭此对话框
 */
CarryBasicInformationInfoDlg.close = function() {
    parent.layer.close(window.parent.CarryBasicInformation.layerIndex);
}

/**
 * 收集数据
 */
CarryBasicInformationInfoDlg.collectData = function() {
    this
    .set('id')
    .set('carryId')
    .set('carryNumber')
    .set('carryDate')
    .set('carryTradePerson')
    .set('carryCarId')
    .set('carryCarDriver')
    .set('carryCarDriverTell')
    .set('carryCarDriverMobile')
    .set('carryRouteId')
    .set('carryRouteStart')
    .set('carryRouteEnd')
    .set('carryRouteTransferStation')
    .set('carryState')
    .set('carryCheck')
    .set('carryRemark');
}

/**
 * 提交修改
 */
CarryBasicInformationInfoDlg.editSubmit = function(str) {
	var type=str;
	var id=parseInt($("#id").val());
    var modelCheck = {};
    modelCheck.id=id;
    modelCheck.type=type;
    
    var jsonData = JSON.stringify(modelCheck);
    $.ajax({
		async : false,
		type : 'post',
		url : Feng.ctxPath+'/carryBasicInformation/updatecheck',
		contentType : "application/json;charset=UTF-8",
		data :jsonData,
		success : function(data) {
			if (data == 'SUCCESS') {
				Feng.success("操作成功!");
		        window.parent.CarryBasicInformation.table.refresh();
		        CarryBasicInformationInfoDlg.close();
			} else {
				 Feng.error("操作失败!该登记已被审核！");
			}
		},
		error : function(data) {
			 Feng.error("操作失败!");
		}
	});
}

$(function() {

});
